home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funcall.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  840 b   |  42 lines

  1. /*
  2. \funcref{fun\_call}{void fun\_call ()}
  3.     {}
  4.     {}
  5.     {getint16(), push()}
  6.     {fun\_ret()}
  7.     {funcall.c}
  8.     {
  9.  
  10.         This function is executed whan an {\em op\_call} opcode is read.
  11.         Following the opcode a 16-bits unsigned value is expected, stating the
  12.         offset of the function to call.
  13.  
  14.         The offset of the next instruction is pushed as an {\em e\_int}
  15.         variable. Then the file pointer associated with the binary makefile is
  16.         set to the offset of the called function.
  17.  
  18.     }
  19. */
  20.  
  21. #include "icm-exec.h"
  22.  
  23. void fun_call ()
  24. {
  25.     VAR_
  26.         tmp;
  27.     UNS16
  28.         offs;
  29.  
  30.     offs = (UNS16) getint16 (infile);
  31.  
  32.     tmp.type = e_int;
  33.     tmp.vu.intval = (unsigned) ftell (infile);
  34.     push (tmp);
  35.  
  36.     fseek (infile, (INT32) offs, SEEK_SET);
  37.  
  38.     tmp.vu.intval = bp;
  39.     push (tmp);
  40.     bp = sp;
  41. }
  42.